package com.cc.wechat.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.cc.wechat.dto.request.PrivateMessageRequest;
import com.cc.wechat.entity.PrivateMessage;

/**
 * 消息服务接口
 */
public interface MessageService extends IService<PrivateMessage> {

    /**
     * 发送私聊消息
     * @param request 消息请求
     * @return 发送的消息
     */
    PrivateMessage sendPrivateMessage(PrivateMessageRequest request);

    /**
     * 获取私聊消息
     * @param friendId
     * @param page
     * @param size
     * @return
     */
    Page<PrivateMessage> getPrivateMessages(Long friendId, Integer page, Integer size);

    /**
     * 标记消息为已读
     * @param friendId
     */
    void markMessagesAsRead(Long friendId);

    /**
     * 撤回消息
     * @param messageId
     */
    void recallMessage(Long messageId);
}